next up previous
Next: 3.2 Example Up: 3 The Overlay Visuals Previous: 3 The Overlay Visuals

3.1 Sample Xlib Programming Interface

The convention does not specify an Xlib interface to query the SERVER_OVERLAY_VISUALS property. Client programmers wishing to use overlay windows have been forced to query and decode the property without help from utility routines. This article includes routines that mimic the Xlib XGetVisualInfo and XMatchVisualInfo routines, but are augmented to also provide support for querying the layering and transparency capabilities of visuals. The implementations of the routines written in C can be found in appendices A and B.

XGetLayerVisualInfo works like XGetVisualInfo but instead of using a XVisualInfo structure as a template and to return information on each visual, a XLayerVisualInfo structure is used which has the XVisualInfo structure embedded in it but also contains fields for layer and transparency. The normal visual information mask bits are extended to support the new fields. The routine hides all the work done to query and interpret the SERVER_OVERLAY_VISUALS property.

XMatchLayerVisualInfo works like XMatchVisualInfo but is extended in the same way XGetLayerVisualInfo is using the XLayerVisualInfo structure. You can supply an additional layer parameter for matching a visual in a specified layer.

As mentioned earlier, a single overlay visual may support several transparency values. These routines only return a single transparency type and value.



next up previous
Next: 3.2 Example Up: 3 The Overlay Visuals Previous: 3 The Overlay Visuals



Mark Kilgard
Sun Jan 7 19:28:30 PST 1996